﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Hide();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            var uid = UtextBox1.Text;
            var pwd = PtextBox2.Text;
            var repwd = RPtextBox3.Text;

            var hasUid = !string.IsNullOrEmpty(uid);
            var hasPwd = !string.IsNullOrEmpty(pwd);
            var eqPwd = pwd == repwd;

            if (hasUid&&hasPwd&&eqPwd)
            {
                MessageBox.Show("注册成功");
                Form1.users.Add(uid, pwd);
                this.Close();
            }
            else
            {
                this.Close();
            }

        }
    }
}
